<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link href="http://www.sgfoot.com/favicon.png" rel="shortcut icon"/>
    <title>日记查看系统</title>
    <link rel="stylesheet" href="/pear/css/pear.css" />
    <script src="/component/layui/layui.js?v=2.8.12"></script>
    <script src="/component/pear/pear.js"></script>
    <style type="text/css">
        ul {
            margin-left:10px;
            margin-right:10px;
            margin-top:10px;
            padding: 0;
        }
        li {
            width: 24%;
            float: left;
            margin: 0px;
            margin-left:1%;
            padding: 0px;
            height: 100px;
            display: inline;
            line-height: 100px;
            color: #fff;
            font-size: x-large;
            word-break:break-all;
            word-wrap : break-word;
            margin-bottom: 5px;
        }
        a {
            -webkit-tap-highlight-color: rgba(0,0,0,0);
            text-decoration:none;
            color:#fff;
        }
        a:link{
            -webkit-tap-highlight-color: rgba(0,0,0,0);
            text-decoration:none;
            color:#fff;
        }
        a:visited{
            -webkit-tap-highlight-color: rgba(0,0,0,0);
            text-decoration:none;
            color:#fff;
        }
        a:hover{
            -webkit-tap-highlight-color: rgba(0,0,0,0);
            text-decoration:none;
            color:#fff;
        }
        a:active{
            -webkit-tap-highlight-color: rgba(0,0,0,0);
            text-decoration:none;
            color:#fff;
        }
        .footer{
            position: absolute;
            top:95%;
            left:44%;
        }
        .footer a{
            color:#1E9FFF;
            font-size:14px;
        }
    </style>
</head>
<body>
<h1 align="center">日记查看系统</h1>
<div align="center">
    <ul id="li_html">
    </ul>
</div>
<div class="footer"></div>
<script>
    layui.use(["element", "popup"], function() {
        let loading = layer.load();
        layui.$.ajax({
            url: "/test/viewlog/index",
            type: "POST",
            dataType: "json",
            data: {},
            success: function (res) {
                if (res.code) {
                    return layui.popup.failure(res.msg);
                }
                const assignPath = res.result.assign_path;
                const colors = res.result.colors;
                const domain = res.result.domain;
                let html = '';
                layui.$.each(assignPath,function (i,v) {
                    html += '<li style="background-color:'+colors[i]+'"><a href="/test/viewlog/getview?dirpath='+v.path+'">'+v.name+'</a></li>';
                })
                layui.$('#li_html').html(html);
                layer.close(loading);
            },
            complete: function () {
                layer.close(loading);
            }
        })
    })
</script>
</body>
</html>

